const goTo = (path, loginBool=false) => {
	let login = wx.getStorageSync('isLogin') || false;
	if(loginBool){
		if(login){
			wx.navigateTo({
				url: path
			})
		}else{
			wx.showToast({
				title: '请先登录',
				icon: 'none',
				duration: 2000
			})
			setTimeout(() => {
				let page = getCurrentPages()[0].route;
				wx.setStorageSync('currentPath', page)
				wx.reLaunch({
				  url: '/pages/component/mine/account/login/index',
				})
			},2000)
		}
	}else{
		wx.navigateTo({
			url: path
		})
	}
}

module.exports = {
	goTo
}